home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 428_02 / libsrc / kbdflush.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-13  |  385 b   |  24 lines

  1. /*
  2. ** kbdflush.c
  3. **
  4. ** Pictor, Version 1.51, Copyright (c) 1992-94 SoftCircuits
  5. ** Redistributed by permission.
  6. */
  7.  
  8. #include "pictor.h"
  9.  
  10. /*
  11. ** Clears any characters waiting in the keyboard buffer.
  12. ** Returns the number of characters that were in the buffer.
  13. */
  14. int kbdflush(void)
  15. {
  16.     int i;
  17.  
  18.     for(i = 0;kbdready();i++)
  19.         kbdread();
  20.  
  21.     return(i);
  22.  
  23. } /* kbdflush */
  24.